<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xhtml="http://www.w3.org/1999/xhtml"
	xmlns:xf="http://www.w3.org/2002/xforms"
	xmlns:ev="http://www.w3.org/2001/xml-events"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
	
	<xsl:output name="resultFormat" media-type="application/xhtml" method="xml" 
		encoding="UTF-8" version="1.1" indent="yes" undeclare-prefixes="yes"
		omit-xml-declaration="yes"/>
	
	<xsl:template match="/files">
		<html>
			<head>
				<title>Inbox</title>
				<xf:model><!-- schema="file:../schemas/transform-config.xsd" -->
					<xf:instance id="instance.config">
						<xsl:element name="transform-config"  xmlns="">
							<schema src="null" />
							<output>
								<dir src="../prototype-gs1/output" />
								<filename src="null" />
							</output>
							<mode value="read">
								<file location="null" />
							</mode>
							<annotation src="../prototype-gs1/annotations/annotations.xml" />
							<browser>other</browser>
						</xsl:element>
					</xf:instance>
					
					<xf:message ev:event="message-1">TEST 1</xf:message>
				</xf:model>
			</head>
			<body>
				<h1>Berichten</h1>
				<div id="messages">
					<ul>
						<xsl:apply-templates />
					</ul>
				</div>
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="/files/file">
		<!-- 
			<a href="#" onclick="parent.showMessage( '{@src}' )"><xsl:value-of select="@src" /></a>
		-->
		<li>
			<xf:trigger>
				<xf:label><xsl:value-of select="@src" /></xf:label>
				<xf:message level="modal" ev:event="DOMActivate"><xsl:value-of select="@src" /></xf:message>
				<xf:action ev:event="DOMActivate">
					<xf:setvalue 
						ref="instance( 'instance.config' )/output/filename/@src"><xsl:value-of select="@src" /></xf:setvalue>
				</xf:action>
			</xf:trigger>
		</li>
	</xsl:template>
</xsl:stylesheet>
